Skip to content

feat(cli): schema-directed coerce for colony config set#37

Merged
NagyVikt merged 1 commit intomainfrom
agent/claude/config-schema-directed-set-2026-04-24-11-01
Apr 24, 2026
Merged

feat(cli): schema-directed coerce for colony config set#37
NagyVikt merged 1 commit intomainfrom
agent/claude/config-schema-directed-set-2026-04-24-11-01

Conversation

@NagyVikt
Copy link
Copy Markdown
Collaborator

Automated by gx branch finish (PR flow).

The old coerce() used regex heuristics to decide whether a value was a
number, boolean, or JSON blob. That turned every stringly-typed field
with numeric content ("1.0", "0.5") into a number and silently stored
the wrong JS type — `colony config set embedding.model 1.0` would
persist the number 1.

Replace it with `coerceForPath(raw, path)` that walks SettingsSchema
down to the target field and coerces based on the leaf zod type. Uses
`_def.typeName` strings instead of `instanceof z.ZodFoo` because the
CLI bundles its own zod copy via tsup and nominal instanceof fails
across bundle boundaries even though the runtime shape matches.
@NagyVikt NagyVikt merged commit 5928655 into main Apr 24, 2026
@NagyVikt NagyVikt deleted the agent/claude/config-schema-directed-set-2026-04-24-11-01 branch April 24, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant